<tr>
  <td>
    <div class="btn-group">
      <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
        <i class="icon-circle-arrow-down"></i> <span class="hidden-phone"><%=t('button.action')%></span>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
        <li>
            <%= link_to edit_transaction_path(transaction, :page => @p) do%>
              <i class="icon-edit"></i> <%=t('button.edit')%>
            <%end%>
        </li>
        <li>
            <%= link_to transaction, confirm: t('message.confirm.delete'), method: :delete do%>
              <i class="icon-remove"></i> <%=t('button.delete')%>
          <%end%>
        </li>
      </ul>
    </div>
  </td>

  <td><div class="badge badge-black-font" style="background-color: <%=getRowColorByDate(transaction.date)%>"><%=transaction.date%></div></td>
  <td><%=transaction.amount%></td>
  <%if transaction.transaction_type == Transaction::TRANSACTION_TO_ACCOUNT ||
          transaction.transaction_type == Transaction::TRANSACTION_TO_CASH%>
      <td>
        <%if !transaction.account_to.description.blank?%>
            <span class="no-disp"><%=transaction.account_to.description%></span>
        <%else%>
            <span class="no-disp"><%=t('common.undefined')%></span>
        <%end%>
        <%=transaction.account_to.name%> (<%=roundFloatTwoDigits(transaction.account_to.amount)%>)
      </td>
  <%elsif transaction.transaction_type == Transaction::TRANSACTION_FROM_ACCOUNT_TO_ACCOUNT ||
            transaction.transaction_type == Transaction::TRANSACTION_FROM_ACCOUNT_TO_CASH ||
            transaction.transaction_type == Transaction::TRANSACTION_FROM_CASH_TO_ACCOUNT ||
            transaction.transaction_type == Transaction::TRANSACTION_FROM_CASH_TO_CASH%>
      <td>
        <%if !transaction.account_from.description.blank?%>
            <span class="no-disp"><%=transaction.account_from.description%></span>
        <%else%>
            <span class="no-disp"><%=t('common.undefined')%></span>
        <%end%>
        <%=transaction.account_from.name%> (<%=roundFloatTwoDigits(transaction.account_from.amount)%>)
      </td>
      <td>
        <%if !transaction.account_to.description.blank?%>
            <span class="no-disp"><%=transaction.account_to.description%></span>
        <%else%>
            <span class="no-disp"><%=t('common.undefined')%></span>
        <%end%>
        <%=transaction.account_to.name%> (<%=roundFloatTwoDigits(transaction.account_to.amount)%>)
      </td>
    <%elsif transaction.transaction_type == Transaction::TRANSACTION_FROM_ACCOUNT_TO_CATEGORY ||
            transaction.transaction_type == Transaction::TRANSACTION_FROM_CASH_TO_CATEGORY%>
      <td>
        <%if !transaction.account_from.description.blank?%>
            <span class="no-disp"><%=transaction.account_from.description%></span>
        <%else%>
            <span class="no-disp"><%=t('common.undefined')%></span>
        <%end%>
        <%=transaction.account_from.name%> (<%=roundFloatTwoDigits(transaction.account_from.amount)%>)
      </td>
      <td>
          <div class="color-indicator-small" style="background-color: <%=getCategoryColor(transaction.category)%>;">&nbsp;</div>
          <%if !transaction.category.description.blank?%>
            <span class="no-disp"><%=transaction.category.description%></span>
          <%else%>
            <span class="no-disp"><%=t('common.undefined')%></span>
          <%end%>
          <%=transaction.category.name%>
      </td>
    <%end%>
    <td class="hidden-phone"><%=transaction.comment %></td>
</tr>
